<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link href="<s:url value="/css/style.css"/>" rel="stylesheet"
			type="text/css" />
		<link href="<s:url value="/css/jquery.css"/>" rel="stylesheet"
			type="text/css" />
		<script type="text/javascript" src="<s:url value="/js/jquery.js"/>"></script>
		<script type="text/javascript" src="<s:url value="/js/jquery-ui.js"/>"></script>
		<script type="text/javascript" src="<s:url value="/js/common.js"/>"></script>
		<script type='text/javascript'
			src="<s:url value="/js/autocomplete/jquery.bgiframe.min.js"/>"></script>
		<script type='text/javascript'
			src="<s:url value="/js/autocomplete/jquery.ajaxQueue.js"/>"></script>
		<script type='text/javascript'
			src="<s:url value="/js/autocomplete/thickbox-compressed.js"/>"></script>
		<script type='text/javascript'
			src="<s:url value="/js/autocomplete/jquery.autocomplete.js"/>"></script>
		<link rel="stylesheet" type="text/css"
			href="<s:url value="/js/autocomplete/jquery.autocomplete.css"/>" />
		<script type="text/javascript" src="<s:url value="/js/jquery-ui.js"/>"></script>
		<link rel="stylesheet" type="text/css"
			href="<s:url value="/js/autocomplete/thickbox.css"/>" />
		<script type="text/javascript"
			src="<s:url value="/js/jquery.blockUI.js"/>"></script>
		<script type="text/javascript"
			src="<s:url value="/js/jquery.validate.js"/>"></script>
		<script type="text/javascript">
	   $(function(){
			 $('#startTime').datepicker({dateFormat:'yy-mm-dd'});
			 $('#endTime').datepicker({dateFormat:'yy-mm-dd'});
			 if($.trim($('#result').text())!=''){
				popupDiv('pop-div');
			 };
			 $('#editForm').validate();
		});
	    function doSave() {
	        var selid=$("#selContractId").val();
	        if (!selid){
	            alert("please select one Contract");
	            return;
	        }
            $('#editForm').submit();
	    };
	     function doDelete() {
	        var  selid=$("#classId").val();
	        if (!selid){
	            return;
	        }
	        selid=$("#selContractId").val();
	        if (!selid){
	            alert("please select one Contract");
	            return;
	        }
	        var form = $('#editForm');
	        form.attr('action',form.attr('action').replace('save','delete'));
            $('#editForm').submit();
	    };
		function goBack(){
			location.href='<s:url value="/clt/CorpContract/redirect?id=%{selContractId}"/>';
		};
</script>
		<s:head />
		<title><s:text name="system.title" /></title>
	</head>
	<body>
		<s:include value="/common/up.jsp"></s:include>
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td class="box">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td id="tag-over">
								<span id="tag-over">Contract</span>
							</td>
							<td class="tab3-line" width="90%">
								&nbsp;
							</td>
						</tr>
					</table>
					<s:form action="CorpClass/save" namespace="/clt" method="post"
						id="editForm" name="editForm">
						<s:hidden id="classId" name="id"></s:hidden>
						<s:hidden id="selContractId" name="selContractId" />
						<table width="100%" border="0" cellpadding="3" cellspacing="1"
							class="margin">
							<tr>
								<td align="right" class="tablecolour5">
									ClassType:
								</td>
								<td class="tablecolour5">
									<s:select name="selClasstypeId" headerKey=""
										headerValue="--select--" list="classTypeList" listKey="id"
										listValue="name"></s:select>
								</td>
								<td align="right" class="tablecolour5">
									Class Count:
								</td>
								<td class="tablecolour5">
									<s:textfield name="classCount" id="classCount"
										cssClass="number" />
								</td>
							</tr>
							<tr>
								<td align="right" class="tablecolour5">
									Teacher:
								</td>
								<td class="tablecolour5">
									<s:select name="selTeacherId"  headerKey=""
										headerValue="--select--" list="teacherList" listKey="id"
										listValue="name"></s:select>
								</td>
								<td align="right" class="tablecolour5">
									Classroom:
								</td>
								<td class="tablecolour5">
									<s:textfield name="classroom" id="classroom" />
								 	Student Count:
								 	<s:textfield name="studendCount" id="studendCount"
										cssClass="number" />
								</td>
							</tr>
							<tr>
								<td align="right" class="tablecolour5">
									Begin:
								</td>
								<td class="tablecolour5">
									<s:date name="startTime" format="yyyy-MM-dd" var="startTimefmt" />
									<s:textfield name="startTime" id="startTime"
										cssClass="input2 required" value="%{startTimefmt}" />
								</td>
								<td align="right" class="tablecolour5">
									End:
								</td>
								<td class="tablecolour5">
									<s:date name="endTime" format="yyyy-MM-dd" var="endTimefmt" />
									<s:textfield name="endTime" id="endTime" value="%{endTimefmt}"
										cssClass="input2 required" />
								</td>
							</tr>
							<tr>
								<td align="right" class="tablecolour5">
									Comment:
								</td>
								<td class="tablecolour5" colspan='3'>
									<s:textarea cols="40" rows="4" name="comments" />
								</td>
							</tr>
							<tr>
								<td align="center" colspan="4" height="50" class="tablecolour5">
									<input type="button" class="btn1" value="Save"
										onclick="doSave();" />
									<input type="button" class="btn1" value="Delete"
										onclick="doDelete();" />
									<input name="goback" type="button" class="btn1" value="Go Back"
										onclick="goBack()" />
								</td>
							</tr>
						</table>
					</s:form>
				</td>
			</tr>
		</table>
		<s:include value="/common/down.jsp"></s:include>
		<div id='pop-div' style="width: 300px;" class="pop-box">
			<s:include value="/common/confirm.jsp"></s:include>
		</div>
	</body>
</html>